package com.xframe.xdal.core.serialize;


import java.util.ArrayList;
import java.util.List;


public class JsonConfig {
    /**
     * 语言
     */
    private String language;
    /**
     * 配置版本
     */
    private String ver;
    /**
     * 文件名称
     */
    private String code;
    /**
     * 查询的KEY
     */
    private String queryKey;

    public String getKey(){
        return (language + "." + ver + "." + code + "." + queryKey).toLowerCase();
    }

    public String getQueryKey(){
        return this.queryKey;
    }

    public String getLanguage() {
        return language;
    }

    public String getVer() {
        return ver;
    }

    public String getCode() {
        return code;
    }

    /**
     * JsonModel字段映射对象集合
     */
    private List<JsonModel> jsonModelList = new ArrayList<>();


    public JsonConfig(String language,String ver,String fileName,String queryKey,List<JsonModel> jsonModelList){
        this.language = language.toLowerCase();
        this.ver = ver.toLowerCase();
        this.code = fileName.substring(0, fileName.indexOf(".json")).toLowerCase();
        this.queryKey = queryKey;
        this.jsonModelList = jsonModelList;
    }

    public List<JsonModel> getJsonModelList() {
        return jsonModelList;
    }
}
